home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 42 / Amiga Format AFCD42 (Issue 126, Aug 1999).iso / -serious- / programming / basic / blitzandpieces / starthack.asc < prev    next >
Encoding:
Text File  |  1999-05-14  |  748 b   |  45 lines

  1.  
  2. ; put in a script to run when you use no-startup-sequence,
  3. ; to automatically resize the "AmigaDOS" window to whatever you want...
  4.  
  5. ;    StartHack 0 8 640 100
  6.  
  7. ;              x y  w   h
  8.  
  9. If FromCLI
  10.  
  11.   FindScreen 0
  12.  
  13.   *scr.Screen = Peek.l(Addr Screen(0))
  14.  
  15.   winlist
  16.   *win.Window = *scr\FirstWindow
  17.   While *win
  18.       If Peek$(*win\Title)="AmigaDOS" Then Goto popout
  19.       *win = *win\NextWindow
  20.   Wend
  21.   *scr=*scr\NextScreen
  22.   If *scr Then Goto winlist
  23.  
  24.   End
  25.  
  26.   popout
  27.  
  28.   Free Screen 0
  29.  
  30.   If NumPars=4
  31.     x.w=Val(Par$(1))
  32.     y.w=Val(Par$(2))
  33.     width.w=Val(Par$(3))
  34.     height.w=Val(Par$(4))
  35.   Else err$="StartHack < x y width height >"+Chr$(10)+Chr$(0):PutStr_ err$
  36.     End
  37.   EndIf
  38.  
  39.   ChangeWindowBox_ *win,x,y,width,height
  40.   End
  41.  
  42. EndIf
  43.  
  44. End
  45.